﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsCullingOBBox : OdGeBoundBlock3d, OdGsCullingPrimitive
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsCullingOBBox(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGsCullingOBBox_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsCullingOBBox obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsCullingOBBox()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsCullingOBBox(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		HandleRef OdGsCullingPrimitive.GetCPtr()
		{
			return new HandleRef(this, GlobalsPINVOKE.OdGsCullingOBBox_OdGsCullingPrimitive_GetCPtr(this.swigCPtr.Handle));
		}

		public OdGsCullingOBBox() : this(GlobalsPINVOKE.new_OdGsCullingOBBox__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingOBBox(OdGePoint3d arg0, OdGeVector3d xAxis, OdGeVector3d yAxis, OdGeVector3d zAxis) : this(GlobalsPINVOKE.new_OdGsCullingOBBox__SWIG_1(OdGePoint3d.getCPtr(arg0), OdGeVector3d.getCPtr(xAxis), OdGeVector3d.getCPtr(yAxis), OdGeVector3d.getCPtr(zAxis)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingOBBox(OdGeBoundBlock3d bb) : this(GlobalsPINVOKE.new_OdGsCullingOBBox__SWIG_2(OdGeBoundBlock3d.getCPtr(bb)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingOBBox(OdGsCullingOBBox obb) : this(GlobalsPINVOKE.new_OdGsCullingOBBox__SWIG_3(OdGsCullingOBBox.getCPtr(obb)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new OdGsCullingOBBox Assign(OdGeBoundBlock3d bb)
		{
			OdGsCullingOBBox result = new OdGsCullingOBBox(GlobalsPINVOKE.OdGsCullingOBBox_Assign__SWIG_0(this.swigCPtr, OdGeBoundBlock3d.getCPtr(bb)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGsCullingOBBox Assign(OdGsCullingOBBox obb)
		{
			OdGsCullingOBBox result = new OdGsCullingOBBox(GlobalsPINVOKE.OdGsCullingOBBox_Assign__SWIG_1(this.swigCPtr, OdGsCullingOBBox.getCPtr(obb)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsCullingPrimitiveImpl.PrimitiveType primitiveType()
		{
			OdGsCullingPrimitiveImpl.PrimitiveType result = (OdGsCullingPrimitiveImpl.PrimitiveType)GlobalsPINVOKE.OdGsCullingOBBox_primitiveType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
